<template>
  <view class="container">
    <!-- 顶部组件 -->
    <u-navbar
      :is-back="true"
      :background="{ background: 'transparent' }"
      :border-bottom="false"
      id="nav-bar"
      title="服务商详情"
    ></u-navbar>

    <image class="bg" src="/static/images/bg.png" mode="widthFix"></image>

    <view class="dataBox">
      <image
        class="dataBox-bg"
        src="/static/images/icon-fwsxqBg.png"
        mode="widthFix"
      ></image>
      <view class="dataBox-content">
        <view class="header">
          <image class="avatar" src="/static/images/logo.png" mode="widthFix"></image>
          <view class="info">
            <view class="label">上海汇付数据服务股份有限公司…</view>
            <view class="value">1298381902381</view>
          </view>
          <u-icon name="arrow-right" :size="28" color="#ffffff"></u-icon>
        </view>
        <view class="bottom">
          <view class="item">
            <image class="img" src="/static/images/icon-jscb.png" mode="widthFix"></image>
            <view class="label">结算成本</view>
          </view>
          <view class="item">
            <image class="img" src="/static/images/icon-ptjl.png" mode="widthFix"></image>
            <view class="label">平台奖励</view>
          </view>
          <view class="item">
            <image class="img" src="/static/images/icon-tjxq.png" mode="widthFix"></image>
            <view class="label">调价奖励</view>
          </view>
        </view>
      </view>
    </view>

    <view class="titleBox"
      ><text>服务商数据</text>
      <image class="img" src="/static/images/icon-tzgg.png" mode="widthFix"></image
    ></view>

    <view class="list">
      <view class="item">
        <view class="header">
          <view class="left">
            <image
              class="left-logo"
              src="/static/images/icon-jy.png"
              mode="widthFix"
            ></image>
            <text class="left-name">交易数据</text>
          </view>
          <view class="right">
            <text class="right-name">查看数据</text>
            <u-icon name="arrow-right" color="#CCCCCC" :size="24"></u-icon>
          </view>
        </view>
        <view class="dataShow">
          <view class="data">
            <view class="value">12012392.83</view>
            <view class="label">总交易额(元)</view>
          </view>
          <view class="data">
            <view class="value">1231.12</view>
            <view class="label">本月交易额(元)</view>
          </view>
          <view class="data">
            <view class="value">4192837.17</view>
            <view class="label">累计交易额(元)</view>
          </view>
        </view>
      </view>

      <view class="item">
        <view class="header">
          <view class="left">
            <image
              class="left-logo"
              src="/static/images/icon-sy.png"
              mode="widthFix"
            ></image>
            <text class="left-name">累计数据</text>
          </view>
        </view>
        <view class="dataShow">
          <view class="data">
            <view class="value">12012392.83</view>
            <view class="label">累计商户(个)</view>
          </view>
          <view class="data">
            <view class="value">1231.12</view>
            <view class="label">直营商户(个)</view>
          </view>
          <view class="data">
            <view class="value">4192837.17</view>
            <view class="label">团队商户(个)</view>
          </view>
        </view>
      </view>

      <view class="item">
        <view class="header">
          <view class="left">
            <image
              class="left-logo"
              src="/static/images/icon-tj.png"
              mode="widthFix"
            ></image>
            <text class="left-name">终端数据(共:12341台)</text>
          </view>
        </view>
        <view class="dataShow">
          <view class="data">
            <view class="value">12012392.83</view>
            <view class="label">未绑定(台)</view>
          </view>
          <view class="data">
            <view class="value">1231.12</view>
            <view class="label">已绑定未激活(台)</view>
          </view>
          <view class="data">
            <view class="value">4192837.17</view>
            <view class="label">已激活(台)</view>
          </view>
        </view>
      </view>
    </view>

    <view class="section">
      <view class="section-in">
        <view class="title">
          <text>团队交易额</text>
          <image
            class="title-sign"
            src="/static/images/icon-tzgg.png"
            mode="widthFix"
          ></image>
          <view class="subsectionBox">
            <u-subsection
              bg-color="#F5F5F5"
              :list="subsectionList"
              :current="1"
            ></u-subsection
          ></view>
        </view>
        <view class="chart">
          <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
        </view>
      </view>
    </view>

    <view class="section mt30">
      <view class="section-in">
        <view class="title">
          <text>团队激活终端数</text>
          <image
            class="title-sign"
            src="/static/images/icon-tzgg.png"
            mode="widthFix"
          ></image>
          <view class="subsectionBox">
            <u-subsection
              bg-color="#F5F5F5"
              :list="subsectionList"
              :current="1"
            ></u-subsection
          ></view>
        </view>
        <view class="chart">
          <qiun-data-charts type="column" :opts="opts" :chartData="chartData" />
        </view>
      </view>
    </view>
  </view>
</template>
<script>
import service from '@/common/service';
import util from '@/common/utils';

export default {
  data() {
    return {
      currentData: {},
      list: [],
      subsectionList: ['7天', '半年'],
    };
  },
  onLoad(e) {},
  methods: {
    customBack() {
      uni.switchTab({
        url: '/pages/my/index',
      });
    },
    getData() {
      const that = this;
      const param = {
        status: that.tabCurrent,
      };
      service.getTradePage(
        param,
        function (res) {
          if (res && res.data) {
            that.mescroll.endSuccess(res.data.data.length);
            if (page.num == 1) that.recordList = [];
            that.recordList = that.recordList.concat(res.data.data);
          }
        },
        function (res) {}
      );
    },
  },
};
</script>

<style lang="scss" scoped>
page {
  background-color: #f5f5f5;
}

.container {
  width: 100%;
  min-height: 100vh;
  padding: 0 0 60rpx;
  text-align: center;
  background-color: #f5f5f5;
  .bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;
  }
}

.section {
  position: relative;
  width: 100%;
  height: auto;
  padding: 0 30rpx;
  z-index: 99;
  .section-in {
    width: 100%;
    height: auto;
    padding: 30rpx;
    background: #ffffff;
    border-radius: 20rpx;
  }
  .title {
    position: relative;
    display: flex;
    justify-content: space-between;
    width: 100%;
    text {
      position: relative;
      font-weight: 800;
      font-size: 28rpx;
      color: #333333;
      z-index: 9;
    }
    .title-sign {
      position: absolute;
      top: -10rpx;
      left: 130rpx;
      width: 32rpx;
      height: auto;
      z-index: 1;
    }
    .subsectionBox {
      width: 248rpx;
    }
  }
  .chart {
    position: relative;
    width: 100%;
    height: 300rpx;
    background: #ffffff;
    border-radius: 20rpx;
  }
}

.list {
  position: relative;
  width: 100%;
  padding: 30rpx 30rpx 0;
  overflow: hidden;
  z-index: 99;
  .item {
    float: left;
    margin-bottom: 30rpx;
    width: 100%;
    padding: 30rpx;
    background: #ffffff;
    border-radius: 20rpx;
    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      .left {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        .left-logo {
          width: 36rpx;
          height: auto;
        }
        .left-name {
          margin-left: 15rpx;
          font-weight: bold;
          font-size: 28rpx;
          color: #333333;
        }
      }
      .right {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        .right-name {
          margin-right: 15rpx;
          font-weight: 400;
          font-size: 24rpx;
          color: #999999;
        }
      }
    }
    .dataShow {
      display: flex;
      justify-content: space-between;
      margin-top: 30rpx;
      width: 100%;
      padding: 30rpx;
      background: #f7f7f7;
      border-radius: 16rpx;
      .data {
        flex: 1;
        min-width: 0;
        text-align: center;
        .value {
          font-family: DIN, sans-serif;
          font-weight: bold;
          font-size: 32rpx;
          color: #333333;
        }
        .label {
          margin-top: 12rpx;
          font-weight: 400;
          font-size: 24rpx;
          color: #999999;
        }
      }
    }
  }
}

.mt0 {
  margin-top: 0 !important;
}

.mt30 {
  margin-top: 30rpx !important;
}

.titleBox {
  position: relative;
  width: 100%;
  padding: 20rpx 30rpx 10rpx;
  text-align: left;
  line-height: 1;
  text {
    position: relative;
    font-family: PingFang SC, sans-serif;
    font-weight: 800;
    font-size: 28rpx;
    color: #333333;
    z-index: 9;
  }
  .img {
    position: absolute;
    top: 15rpx;
    left: 130rpx;
    width: 32rpx;
    height: auto;
    z-index: 1;
  }
}

.dataBox {
  position: relative;
  margin-top: 30rpx;
  width: 100%;
  padding: 0 30rpx;
  .dataBox-bg {
    width: 100%;
    height: auto;
  }
  .dataBox-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 40rpx 60rpx 50rpx;
    line-height: 1;
    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      text-align: left;
      .avatar {
        width: 120rpx;
        height: 120rpx;
        border-radius: 50%;
      }
      .info {
        flex: 1;
        min-width: 0;
        padding-left: 26rpx;
        .label {
          font-weight: bold;
          font-size: 28rpx;
          color: #ffeacc;
        }
        .value {
          margin-top: 20rpx;
          font-weight: 400;
          font-size: 24rpx;
          color: rgba($color: #ffffff, $alpha: 0.5);
        }
      }
    }
    .bottom {
      display: flex;
      justify-content: space-between;
      margin-top: 40rpx;
      text-align: center;
      .item {
        flex: 1;
        min-width: 0;
        text-align: center;
        .img {
          width: 83rpx;
          height: 83rpx;
        }
        .label {
          margin-top: 6rpx;
          font-weight: 400;
          font-size: 22rpx;
          color: rgba($color: #ffffff, $alpha: 0.6);
        }
      }
    }
  }
}
</style>
